import {setColumnsDefaultKey, constantFormatHtml} from '@/utils/common'
import {toDateString} from "ele-admin/packages/util";

let column = [
  {
    prop: 'UserID',
    label: '账号ID',
    width: 90
  },
  {
    prop: 'UserName',
    label: '账号',
  },
  {
    prop: 'NickName',
    label: '昵称',
  },
  {
    prop: 'IsSuper',
    label: '用户类型',
    formatter: (row, column, val) => {
      return constantFormatHtml(val, 'UserPower')
    }
  },
  {
    prop: 'RoleID',
    label: '角色',
    slot: 'Role'
  },
  {
    prop: 'CreateTime',
    label: '创建时间',
    width: 140,
    formatter: (row, column, val) => {
      return toDateString(val * 1000)
    }
  },
  {
    columnKey: 'action',
    label: '操作',
    width: 200,
    align: 'center',
    resizable: false,
    slot: 'action'
  }
]

export default setColumnsDefaultKey(column)
